//package pers.zb.cloud.order.config;
//
//import feign.Response;
//import feign.Util;
//import feign.codec.ErrorDecoder;
//import org.springframework.context.annotation.Configuration;
//
//import java.io.IOException;
//
//@Configuration
//public class FeignErrorDecoder implements ErrorDecoder {
//
//    @Override
//    public Exception decode(String methodKey, Response response) {
//        try {
//            String message = Util.toString(response.body().asReader());
//            return new RuntimeException(message);
//        } catch (IOException ignored) {
//        }
//        return decode(methodKey, response);
//    }
//}